This invention relates to accurately obtaining the Bluetooth Master clock.
A Bluetooth piconet is an ad-hoc Bluetooth network featuring a master node and one or more slave nodes. There can be up to seven active slave nodes in a piconet although additional nodes (up to 255) may remain synchronized to the master but ‘parked’ and not active in the piconet.
Each Bluetooth device features a clock, that has a tick period of 312.5 μs (this equates to half a Bluetooth slot period). The clock of the master device is used as a ‘Master Clock’ within the piconet and is transmitted to the slave devices. Each slave device maintains a clock offset value which is the offset between the master clock and its own clock. This offset value is updated every time a packet is received from the master clock.
For an application running on a slave device, the most accurate available network synchronised clock is the Master Clock. However, the resolution of the Master Clock available to the application is limited by the Host Controller Interface. This limitation, defined by the Bluetooth specification, allows only the most recent clock tick to be visible to the application. Furthermore, the command time, defined as the period of time between when the application requests the Master Clock through the Host Controller interface and when it receives the Master Clock data, is significant, and can add to the inaccuracy of the low resolution representation of the Master Clock time.
Therefore, when the application running on a slave device attempts to estimate the Master Clock time, the estimate is approximated by the equation:Master Clock Estimate=Master Clock+Clock Rounding Error+Clock Drift+Command Time
Given the resolution of the Bluetooth clock, the clock rounding error is 0-312.5 μs. The clock drift of the Master device internal clock is approximately 20 ppm (parts per million) and so assuming that the Master Clock is transmitted to each slave device at least every 25 ms, this will be +/−1 μs. The command time varies with implementation but is typically in the order of several milliseconds.
Therefore, the worst case error is given by:Worst Case Error=312.5 μs+1 μs+2000 μs=2313.5 μs
Given the speed of sound, a sound wave will travel approximately 78 cm in 2313.5 μs. In a stereo environment in which the left and right audio channels are controlled by separate Bluetooth devices, this could result in one channel having a delay of 2313.5 μs relative to the other channel. Given the sophisticated auditory and spatial calculations performed by the brain, this would present to the listener the illusion of a speaker 78 cm away from the expected position. Particularly when used in the present context of a pair of headphones, such spatial variation would be disorientating to the listener.